package com.cloudfun.campusshare.common.model.dto;

import com.cloudfun.campusshare.common.constant.ProductType;
import com.cloudfun.campusshare.common.constant.PromotionType;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * Created by CodeGenerator on 2020/06/06
 */
@Data
@ApiModel("优惠活动创建DTO")
public abstract class PromotionDTO {

    private String id;

    @ApiModelProperty("活动类型")
    @NotNull(message = "该字段不能为空")
    private PromotionType type;

    @ApiModelProperty("洗衣点id")
    @NotEmpty(message = "该字段不能为空")
    private String washPointId;

    @ApiModelProperty("产品类型")
    private List<ProductType> productTypes;

    @ApiModelProperty("名称")
    @NotEmpty(message = "该字段不能为空")
    @Length(min = 2, max = 40, message = "请输入正确的名称")
    private String name;

    @ApiModelProperty("活动开始时间")
    @NotNull(message = "该字段不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime startTime;

    @ApiModelProperty("活动结束时间")
    @NotNull(message = "该字段不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime endTime;

//    @ApiModelProperty("状态")
//    private PromotionStatus status;

}